package com.acerola.yuan_back.controller;

import com.acerola.yuan_back.common.Result;
import com.acerola.yuan_back.dao.NoticeMapper;
import com.acerola.yuan_back.pojo.Notice;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @program: yuan_back
 * @description: 公告管理
 * @author: Acerola
 * @create: 2022-08-16 10:21
 **/
@Api(tags = "公告管理")
@CrossOrigin
@RestController
@RequestMapping("/notice")
public class NoticeController {

    @Autowired
    private NoticeMapper noticeMapper;

    /**
     * 获取最新一条公告
     * @return
     */
    @ApiOperation("获取最新一条公告")
    @GetMapping("/getNewNotice")
    private Result<?> getNewNotice() {
        Notice notice = noticeMapper.getNewNotice();
        return new Result<>().success().put(notice);
    }
}
